public class 逻辑 {
    public static void main(String[] args) {
        int i = 10;
        int j = 20;
        int k = 30;

        //& 逻辑与 两个表达式都为true为true 有一个fause为fause
        System.out.println((i>j)&(i<k));
        System.out.println((i<j)&(i>k));
        System.out.println((i>j)&(i>k));
        System.out.println((i<j)&(i<k));

        //| 逻辑或 有true就是true
        System.out.println((i>j)|(i>k));
        System.out.println((i<j)|(i>k));
        System.out.println((i>j)|(i<k));
        System.out.println((i<j)|(i<k));

        //^ 逻辑异或 相同为fause,不同为true
        System.out.println((i>j)^(i>k));
        System.out.println((i<j)^(i>k));
        System.out.println((i>j)^(i<k));
        System.out.println((i<j)^(i<k));

        //! 逻辑非 非fause是true/非true是fause
        System.out.println(i>j);
        System.out.println(!(i>j));
        System.out.println(!!(i>j));
        System.out.println(!!!(i>j));
        System.out.println("----------");

        //&& 短路与
        System.out.println((i>j)&&(i>k));
        System.out.println((i<j)&&(i>k));
        System.out.println((i>j)&&(i<k));
        System.out.println((i<j)&&(i<k));
        System.out.println("--------");

        //&&和&
        System.out.println((i++>100) & (j++>100));
        System.out.println((i++>100) && (j++>100));//左边是fause右边不执行
        System.out.println("i:" + i );
        System.out.println("j:" + j );
        System.out.println("-------");

        //|| 短路或 左边为真右边不执行  左边是假右边执行
        System.out.println((i>j)||(i>k));
        System.out.println((i<j)||(i>k));
        System.out.println((i>j)||(i<k));
        System.out.println((i<j)||(i<k));
    }
}
